Skip to content

fix(test): cap Rstest worker socket paths - #341

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
fix/335-socket-path-cap
Sep 3, 2026
Merged

fix(test): cap Rstest worker socket paths#341
ScriptedAlchemy merged 2 commits into
mainfrom
fix/335-socket-path-cap

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Closes #335

Summary

  • derive POSIX Rstest worker roots from a 16-hex SHA-256 digest of the upstream temporary root and worker ID, keeping the stable root at /tmp/ab-rstest-<hash16>
  • preserve per-leg/per-worker isolation while reserving at least 12 bytes of documented headroom below Linux's 108-byte sun_path cap for nested Doctor socket fixtures
  • add a pathological long-leg regression, local-CI documentation, and a patch changeset

Red/green evidence

  • baseline issue reproduction: 32/36 Doctor tests passed, with the four socket-bearing cases failing
  • regression before fix: 1/1 failed, requiring 232 bytes against the 96-byte safety budget
  • after fix under the issue's long current-node TMPDIR: 36/36 Doctor tests passed
  • regression after fix: 1/1 passed

Test plan

  • pnpm build
  • long-TMPDIR packages/agent-bundle/tests/doctor.test.ts — 36/36
  • packages/agent-bundle/tests/rstest-worker-isolation.test.ts — 1/1
  • pnpm typecheck
  • pnpm lint — 0 errors, 0 warnings
  • pnpm check:local-ci --current-node-only through unit — build/typecheck/lint and 2616/2621 unit tests passed (5 skipped); the untouched integration cli.test.ts then hit the machine-installed Codex 0.147.0 host-validation diagnostic mismatch

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 919dcb7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T23:46:10.590596Z ba28f12 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@341
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@341
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@341

commit: 919dcb7

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba28f12ed9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

.update(workerId, 'utf8')
.digest('hex')
.slice(0, 16);
return join('/tmp', `ab-rstest-${hash}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep hashed worker roots in the cleanup lifecycle

When check:local-ci is run repeatedly, scripts/local-ci.mjs deletes and recreates only the per-leg TMPDIR, but this path now lives beside it directly under /tmp. Consequently, worker caches such as cache/cmd-<pid>-<serial> and any fixtures left by interrupted tests survive every rerun and accumulate indefinitely, defeating the runner's documented clean-temp guarantee and potentially exhausting /tmp or contaminating later runs. Ensure these hashed roots are removed as part of each run or otherwise tie their lifetime to the per-leg directory.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #397 (merged as d25a9c6). rstest.worker-isolation.ts writes an owner marker (.ab-rstest-owner.json with pid + start time) into each hashed worker root, and scripts/local-ci.mjs calls the new scripts/rstest-worker-roots.mjs to remove only roots whose owner has exited — other lanes' live roots are never touched. Proven by tests/rstest-worker-isolation.test.ts; documented in docs/local-ci.md.

Include the worktree/process invocation identity in short worker roots so parallel runs cannot share temporary fixtures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

local-ci: current-node doctor sockets exceed AF_UNIX path cap

1 participant